import request from "./index.js";

//获取城市 id 的网络请求
export function listAccount(query) {
  query.key = process.env.VUE_APP_SERVICE_KEY;
  console.log("参数：",query)
  return request({
    url: "https://geoapi.qweather.com/v2/city/lookup",
    method: "get",
    params: query,
  });
}
//获取城市 天气
export function listWeather(query) {
  query.key = process.env.VUE_APP_SERVICE_KEY;
  return request({
    url: "https://devapi.qweather.com/v7/weather/now",
    method: "get",
    params: query,
  });
}
//获取七天的天气预报
export function sevenDays(query={}) {
  query.key = process.env.VUE_APP_SERVICE_KEY;
  query.location = process.env.VUE_APP_SERVICE_CITY;
  return request({
    url: "https://devapi.qweather.com/v7/weather/7d",
    method: "get",
    params: query,
  });
}
//获取三十天的天气预报
export function thirtyDays(query={}) {
  query.key = process.env.VUE_APP_SERVICE_KEY;
  query.location = process.env.VUE_APP_SERVICE_CITY;
  return request({
    url: "https://devapi.qweather.com/v7/weather/7d",
    method: "get",
    params: query,
  });
}
